<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button>按钮</button>
  <script>
    // 内置函数
    setTimeout(function () {
      console.log("定时器函数:", this) // Window
    }, 1000)

    var btnEl = document.querySelector("button")
    btnEl.onclick = function () {
      console.log("btn的点击:", this) // <button>按钮</button>
    }

    var names = ["abc", "cba", "nba"]
    names.forEach(function (item) {
      console.log("forEach:", this)
    })

    names.forEach(function (item) {
      console.log("forEach:", this)
    }, 'aaa')


  </script>
</body>

</html>